1. Field of the Invention
This invention relates generally to computer systems and associated hardware, and particularly to methods and apparatuses for creating formatted FAT partitions on a computer readable medium of a hard drive having a BIOS-less controller.
2. Description of the Related Art
A computer system 10, such as shown in FIG. 1, can store and retrieve data from computer readable media in various forms such as magnetic disks, magnetic tapes, and the like. To do so, the computer system 10 can include or be connected to a media drive which physically interacts with the medium 12 and translates data between the computer system and the medium. Such a media drive can be a hard drive, a tape drive, a floppy disk drive, a CD drive, etc. The media drive can be internal to the computer system or can be an external peripheral device 14 that is connected to the computer system as shown in FIG. 1.
To facilitate communication between the computer system 10 and the peripheral device 14, the computer system 10 includes a controller card 16 which is connected to a central processing unit (CPU) 18 of the computer system 10 through a bus 20. To utilize the computer system 10, an operating system (OS), such as Windows 95.TM. or DOS.TM., is run by the CPU 18. The controller card 16 enables communication between the peripheral device 14 and the OS via a communication protocol such as EIDE on SCSI. As shown in FIG. 2A, the controller card 16 includes a controller 22 connected to an option read-only-memory (ROM) 24. The controller 22 enables communication between the peripheral device 14 and the OS via a communication protocol such as EIDE on SCSI. As is well known, the option ROM 24 contains code in the form of a BIOS that enables the OS to identify the type of controller 16 connected to the computer system 10 and the type of peripheral devices 14 connected to the controller card 16. Thus, when a controller card 16 has an option ROM 24, it can be recognized during bootup and therefore can function as a boot device. Alternatively, a controller card such as controller card 16' of FIG. 2B can include a controller 22 without an option ROM 24.
FIG. 3 is a schematic of data storage space 26 of a computer readable medium, such as a disk of a hard disk drive. Also noted is the type of data that can be resident on a partitioned and formatted disk. A master boot record (MBR) can begin at the beginning of the data storage space 27. Included in the master boot record MBR is data which identifies the beginning location, also sometimes referred to as the location of other partitions on the disk. For example, the respective locations 28 and 29 of a primary partition D:, and a first extended partition P1 can be included. The primary partition D: is a file allocation table (FAT) partition which includes a boot sector 30 made up of multiple variables which describe the data structure of the primary partition D:. The primary partition D: also includes reserved data storage space 31 which is made available for future data.
The first extended partition P1 includes a first partition boot record PBR-1 which contains respective locations 32 and 33 of a first logical drive E:. Also shown is a second extended partition P2. The first logical drive E: also is a FAT partition and includes a boot sector 34 which performs the same function for the first logical drive E: as the boot sector 30 does for the primary partition D:. Also as does the primary partition D:, the first logical drive E: includes reserved data storage space 35 which is made available for future data. The second extended partition P2 includes a second partition boot record PBR-2 that can contain further locations of other logical drives or other extended partitions. Of course, the remainder of the data storage space 26 can also include other extended partitions with other partition boot records and other logical drives with other boot sectors and other reserved data storage space. Also, between the master boot record MBR and the disk partitions, as well as between each partition, is included unused data storage space 36.
To facilitate data location on the disk, the above locations are described in two different coordinate systems. In a first coordinate system, a cylinder-head-sector (CHS) location is given as three coordinates which describe the location of a sector relative to other sectors in the same head, sometimes referred to as a track of the disk. Further, this describes the location of a head relative to other heads on the disk, and the location of the cylinder relative to other cylinders on the disk. In contrast, the second coordinate system provides a logical block address (LBA) for a sector, which is an absolute location on the disk. For example, the master boot record MBR has a cylinder-head-sector (CHS) location of 0,0,1 which corresponds to an LBA location of 0. In general, these systems are used to create and format partitions on the disk as described in more detail below.
FIG. 4 is a process diagram for a method 40 of creating formatted partitions on a computer readable medium such as a disk, according to the prior art. In operation 42 the sizes of the partitions are input while in operation 44 the types of these partitions are input. For example, the sizes of the partitions and the types of partitions can be input by a user of the computer system 10. In operation 46 the partitions are created on the disk. In operation 48 the computer system is rebooted, and the disk is formatted in operation 50. With operating systems such as Windows 95.TM. and DOS.TM., operations 42, 44, and 46 can be performed using program instructions referred to as FDISK operations, while operation 50 can be performed using program instructions referred to as FORMAT.
FIG. 5 is a process diagram further detailing the operations of operation 46 of FIG. 4. In operation 52 the master boot record (MBR) is populated with data including the CHS location and LBA of the various boot sectors of the partitions. In operation 54, each of the boot sectors of each of the partitions are populated with the value "F6" for substantially all of the variables. FIG. 6 depicts a process diagram further outlining the operations of operation 50 in FIG. 4. The user selects the partitions to be formatted in operation 56. Once the partitions to be formatted have been selected, the process advances to write full boot sector data at CHS or LBA locations. Typically, this formatting operation is performed using a Microsoft Windows formatting tool.
Unfortunately, when the above method is practiced with an operating system such as Windows 95.TM. or DOS.TM., the use of the CHS location to write the boot sector data can result in the misplacement of some boot sectors on the disk. In particular, a boot sector, that is desired to be located beyond the first gigabyte of a disk having a data storage space of greater than one gigabyte, may be incorrectly placed within the first gigabyte of the data storage space. This is exemplified in FIG. 7 schematically depicting a data storage space 70 of two gigabytes (2 GB). Here, the first and second sectors BOOT 1 and BOOT 2 are desired to be, and have been, placed within the first gigabyte of the data storage space 70. A third boot sector BOOT 3 is desire to be located in the third boot sector location 72 which is beyond the first gigabyte of the data storage space 70.
However, this can be performed improperly in the case of an operating system which uses the operations of FIGS. 4 through 6, such that the full boot sector data is written at the CHS. Specifically, the third boot sector BOOT 3 is undesirably placed at a location 74 within the first gigabyte of the data storage pace 70. In the case shown in FIG. 7, the third boot sector BOOT 3 is therefore within the portion of the data storage space allocated to the partition associated with the first boot sector BOOT 1. Therefore, data that is desired to be written to and retrieved from the partition associated with the first boot sector BOOT 1 can be overwritten and or corrupted by data that is written to the third boot sector BOOT 3. Also, the reverse can be true, with data desired to be written to or retrieved from the third boot sector BOOT 3 being possibly corrupted or inaccessible.
Thus, it is desired to provide a method and apparatus for creating a desired formatted partition beyond the first gigabyte of a disk that is associated with a controller card that does not have a BIOS on an option-ROM, and in conjunction with certain operating systems (e.g., Windows 95.TM., DOS.TM., etc.). In particular it is desired that the partition actually be located beyond the first gigabyte without corrupting data of other partitions or making the data of the desired partition unavailable.